      <div class="templatemo-content-wrapper">
        <div class="templatemo-content">
          <ol class="breadcrumb">
            <li><a href="<?=site_url()?>/product/index">商品管理</a></li>
            <li class="active">价格变动</li>
          </ol>
          <div class="row">
          	<div class="col-md-12">
          		<a class="btn btn-primary" href="<?=site_url()?>/product/notice">生成通知</a>
          	</div>
          	<div class="col-md-12">
            	<input type="text" id="name" name="name" value="" placeholder="请输入商品名称">
            	<button class="btn btn-primary" id="submit_btn">搜索</button>
            </div>
            <div class="col-md-12">
              <div class="table-responsive">
                <h4 class="margin-bottom-15">价格变动记录</h4>
                <table class="table table-striped table-hover table-bordered">
                  <thead>
                    <tr>
                      <th>商品ID</th>
                      <th>商品名称</th>
                      <th>调整前价格</th>
                      <th>调整后价格</th>    
                      <th>日期</th>        
                    </tr>
                  </thead>
                  <tbody>
                  	<?php foreach ($pricechanges as $item):?>
                    <tr>
                      <td><?php echo $item['id'];?></td>
                      <td><?php echo $item['name'];?></td>
                      <td><?php echo $item['oldprice'].'元/'.$item['unit'];?></td>
                      <td><?php echo $item['price'].'元/'.$item['unit'];?></td>
                      <td><?php echo $item['update_time'];?></td>
                    </tr>
                     <?php endforeach;?>
                  </tbody>
                </table>
              </div>
            </div>
          </div>
           <div class="pagination">
            <?php echo $links ;?>
          </div>
        </div>
      </div>
       <script>
	$(document).ready(function() {
		$("#submit_btn").click(function() {
			var name = $("#name").val();
			if(name==""||name==null){
				name="empty";
			}
			var url = "<?php echo site_url('product/pricechange')?>";
			window.location.href=url+"/name/"+name;
		});
		$("#name").keydown(function(e) {
			if(e.keyCode == 13) {
				var name = $("#name").val();
				if(name==""||name==null){
					name="empty";
				}
				var url = "<?php echo site_url('product/pricechange')?>";
				window.location.href=url+"/name/"+name;
			}
		});
	}); 
</script>